<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "pay_order_info".
 *
 * @property int $oid
 * @property int $aid 应用id
 * @property int $mid 商户id
 * @property string $pay_order_sn 支付订单号
 * @property string $mar_order_sn 商户订单号
 * @property string|null $ref_order_sn 退款单号
 * @property int $pay_money 支付金额
 * @property string $pay_status 1-订单生成，2-支付中，3-支付成功，4-处理完成，5-已退款
 * @property string $is_refund 1-未退款，2-已退款
 * @property string|null $client_id 客户端ip
 * @property string|null $facility 设备
 * @property int $refund_money 退款金额
 * @property string|null $goods_name 商品名称
 * @property string|null $goods_desc 商品备注
 * @property string|null $callback_url 回调地址
 * @property string|null $failure_time 失效时间
 * @property string|null $success_time 成功时间
 * @property string $create_time 创建时间
 */
class OrderInfo extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'pay_order_info';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['aid', 'mid', 'pay_order_sn', 'mar_order_sn', 'pay_money', 'create_time','app_id'], 'required'],
            [['aid', 'mid', 'pay_money', 'refund_money','app_id'], 'integer'],
            [['pay_status', 'is_refund'], 'string'],
            [['failure_time', 'success_time', 'create_time'], 'safe'],
            [['pay_order_sn', 'mar_order_sn', 'ref_order_sn'], 'string', 'max' => 24],
            [['client_id'], 'string', 'max' => 32],
            [['facility'], 'string', 'max' => 10],
            [['goods_name'], 'string', 'max' => 64],
            [['goods_desc', 'callback_url'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'oid' => 'Oid',
            'app_id' => 'App Id',
            'aid' => 'Aid',
            'mid' => 'Mid',
            'pay_order_sn' => 'Pay Order Sn',
            'mar_order_sn' => 'Mar Order Sn',
            'ref_order_sn' => 'Ref Order Sn',
            'pay_money' => 'Pay Money',
            'pay_status' => 'Pay Status',
            'is_refund' => 'Is Refund',
            'client_id' => 'Client ID',
            'facility' => 'Facility',
            'refund_money' => 'Refund Money',
            'goods_name' => 'Goods Name',
            'goods_desc' => 'Goods Desc',
            'callback_url' => 'Callback Url',
            'failure_time' => 'Failure Time',
            'success_time' => 'Success Time',
            'create_time' => 'Create Time',
        ];
    }
}
